package com.linchuan.concurrency;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class SingleThreadWebServer {
  public static void main(String[] args) throws IOException {
    ServerSocket socket = new ServerSocket(8011);
    while (true) {
      Socket connection = socket.accept();
      var input = connection.getInputStream();
      System.out.println(new String(input.readAllBytes()));
      //      System.out.println(input);
      connection.close();
    }
  }
}
